﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Specialized;

public partial class wap_score : System.Web.UI.Page
{
    NameValueCollection nvc;
    protected string id;
    protected int status;

    protected void Page_Load(object sender, EventArgs e)
    {
        nvc = Request.Form;
        int total = 0;
        bool flag = false;
        if (nvc["q1"] != null)
        {
            if (nvc["q1"] == "Y")
            {
                total += 50;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第一道题", Page);
            flag = false;
        }
        if (nvc["q2"] != null)
        {
            if (nvc["q2"] == "Y")
            {
                total += 10;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第二道题", Page);
            flag = false;
        }

        if (nvc["q3"] != null)
        {
            if (nvc["q3"] == "Y")
            {
                total += 10;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第三道题", Page);
            flag = false;
        }

        if (nvc["q4"] != null)
        {
            if (nvc["q4"] == "Y")
            {
                total += 10;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第四道题", Page);
            flag = false;
        }

        if (nvc["q5"] != null)
        {
            if (nvc["q5"] == "Y")
            {
                total += 10;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第五道题", Page);
            flag = false;
        }

        if (nvc["q6"] != null)
        {
            if (nvc["q6"] == "Y")
            {
                total += 10;
                flag = true;
            }
        }
        else
        {
            JSAction.alert("请选择第六道题", Page);
            flag = false;
        }

        if (nvc["q1"] == "N" && nvc["q2"] == "N" && nvc["q3"] == "N" && nvc["q4"] == "N" && nvc["q5"] == "N" && nvc["q6"] == "N")
        {
            flag = true;
        }

        if (total >= 50 && flag == true)
        {
            JSAction.parentRedirectUrl("result_one_h.asp", Page);
        }
        if (total >= 30 && total < 50 && flag == true)
        {
            JSAction.parentRedirectUrl("result_one_m.asp", Page);
        }
        if (total < 30 && flag == true)
        {
            JSAction.parentRedirectUrl("result_one_l.asp", Page);
        }

        //try
        //{
        //    id = Session["id"] == null ? "" : Session["id"].ToString();
        //    int flag;
        //    if (id != null || id != "")
        //    {
        //        flag = BLLUserInfo.updTestDrive(nvc["drivenum"], nvc["driveage"], nvc["driveaddress"], nvc["drivetime"], id);
        //        if (flag > 0)
        //        {
        //            Response.Redirect("../../registration/applyresult.wml");
        //        }

        //    }
        //}
        //catch (Exception)
        //{
        //}
    }
}
